package com.info3k.client;

import java.util.List;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.info3k.client.domain.Address;
import com.info3k.client.domain.Category;
import com.info3k.client.domain.Event;
import com.info3k.client.domain.Location;
import com.info3k.client.domain.User;

/**
 * The async counterpart of <code>Info3KService</code>.
 */
public interface Info3KServiceAsync {
	void isAvailableUsername(String username, AsyncCallback<Boolean> callback);
	void registerUser(User u, String response, String challenge, AsyncCallback<Boolean> callback);
	void logInUser(String username, String password,
			AsyncCallback<User> callback);
	void checkIfLogged(AsyncCallback<User> callback);
	void logOutUser(User u, AsyncCallback<Boolean> callback);
	void addLocation(Location location, AsyncCallback<Void> callback);
	void addAddress(Address address, AsyncCallback<Void> callback);
	void getAddressesByFilter(String filter, Integer pageSize, Integer current,
			AsyncCallback<List<Address>> callback);
	void getLocationsByFilter(String filter,
			Category category, Integer pageSize, Integer current, AsyncCallback<List<Location>> callback);
	void getLatestAddress(int count, AsyncCallback<List<Address>> callback);
	void getLatestLocations(int count, AsyncCallback<List<Location>> callback);
	void infoServer(String s, AsyncCallback<Void> callback);
	void getLocationsByUser(User user, Integer pageSize, Integer current, AsyncCallback<List<Location>> callback);
	void getAddressesByUser(User user, Integer pageSize, Integer current, AsyncCallback<List<Address>> callback);
	void getLatestUsers(int count, AsyncCallback<List<User>> callback);
	void getAllCategories(AsyncCallback<List<Category>> callback);
	void addCategory(Category address, AsyncCallback<Void> callback);
	void addEvent(Event event, AsyncCallback<Void> callback);
	void getLatestEvents(int count, AsyncCallback<List<Event>> callback);
	void rateEvent(Event loc, Double rate, AsyncCallback<Void> callback);
	void viewEvent(Event event, AsyncCallback<Void> callback);
	void rateLocation(Location loc, Double rate, AsyncCallback<Void> callback);
	void viewLocation(Location loc, AsyncCallback<Void> callback);
	void getEventsByFilter(String filter, Integer pageSize, Integer current, AsyncCallback<List<Event>> callback);
	void getEventsByUser(User user, Integer pageSize, Integer current, AsyncCallback<List<Event>> callback);
	void addUser(User u, AsyncCallback<Void> callback);
	void recoverPassword(String username, String response, String challenge,
			AsyncCallback<Boolean> callback);
	void changePasswordForUser(User u, String oldPassword, String newPassword, AsyncCallback<User> callback);
}
